package com.easyaop.api;

import com.easyaop.api.around.Around;
import com.easyaop.api.event.listener.MethodListener;
import com.easyaop.api.pointcut.Pointcut;

import java.lang.reflect.Method;

public interface EasyAopTemple extends Events, Arounds{
    void add(String expression, Around around);

    void add(Method method, Around around);

    void add(Pointcut pointcut, Around around);

    /**
     * @param expression  表达式
     * @param aroundTypes aroundTypes为空清空该切点所有Around,不为空删除特定
     */
    boolean remove(String expression, Class<? extends Around>... aroundTypes);

    boolean remove(Method method, Class<? extends Around>... aroundTypes);


    boolean removeEventListener(Pointcut pointcut, Class<? extends MethodListener> listener);

    //    void removeEventListener(Method method, Class<? extends MethodListener> listener);


    void addEventListener(Pointcut pointcut, MethodListener listener);

    void addEventListener(String expression, MethodListener listener);

    void addEventListener(Method method, MethodListener listener);


}
